package com.snapp.web.actions.statics;

import java.util.Vector;

import javax.servlet.http.HttpServletRequest;

import com.snapp.util.Statics;
import com.snapp.util.object.model.ObjectModel;
import com.snapp.util.object.model.ObjectImpl;
import com.snapp.web.SNAppAction;

public class List extends SNAppAction {

	public String execute(HttpServletRequest req) {
		
		try {
			String mnemonic = req.getParameter("mnemonic");
				
			Vector<ObjectModel> tps = Statics.list(mnemonic);
			setBodyElement(ObjectImpl.listToXML(tps));
			
			setResultCode(1);
			setResultMessage("Statics list loaded successfully");
			
		}catch(Exception e) {
			log("Error loading object from statics", e);
			setResultCode(-1);
			setResultMessage("Error loading list from statics");
		}
		
		return super.execute(req);
	}

}
